package org.dtrd.modules.control.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.dtrd.modules.control.entity.po.DtrdEntRdSigninTargetDetail;
import org.dtrd.modules.control.entity.po.DtrdEntRdSigninTargetDetailDto;

import java.util.List;

/**
 * @Entity modules.control.entity.po.DtrdEntRdSigninTargetDetail
 */
public interface DtrdEntRdSigninTargetDetailMapper extends BaseMapper<DtrdEntRdSigninTargetDetail> {

    List<DtrdEntRdSigninTargetDetail> getTargetDetailList(@Param("targetId") Integer targetId);

    List<String> selectTargetStatusByType(@Param("type") Integer type,
                                          @Param("patientId") Integer patientId);

    List<DtrdEntRdSigninTargetDetailDto> selectTargetStatus(@Param("patientId") Integer patientId, @Param("startDate") String startDate, @Param("endDate") String endDate);

    List<String> selectDrugStatus(@Param("type") Integer type,
                                  @Param("patientId") Integer patientId);

    /**
     * 保存控制目标详情的真实值
     */
    boolean updateTargetDetailRealValue(@Param("targetId") Integer targetId,
                                        @Param("value") Float value,
                                        @Param("projectType") Integer projectType);

    /**
     * 查询达标率
     */
    List<DtrdEntRdSigninTargetDetail> selectTargetDetails(@Param("patientId") Integer patientId,
                                                          @Param("startDate") String startDate,
                                                          @Param("endDate") String endDate);

    List<DtrdEntRdSigninTargetDetail> selectTargetDetailsByType(@Param("patientId") Integer patientId,
                                                                @Param("startDate") String startDate,
                                                                @Param("endDate") String endDate);

    List<Integer> selectTargetTypes(@Param("patientId") Integer patientId);
}




